/*
 * Copyright 2020 The Kubernetes Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../Card/mixins';

@mixin BarHeight {
  --row-border: none;
  --font-size--secondary: 0.6875rem;
  --font-size--tertiary: 0.625rem;

  /* --row-border: 1px solid var(--color-table-border1); */
  &[data-size='small'] {
    --bar-height: #{$bar-height-small};
  }
  &[data-size='medium'] {
    --bar-height: #{$bar-height-medium};
  }
  &[data-size='large'] {
    --bar-height: #{$bar-height-large};
    --font-size--secondary: 0.5625rem;
    --font-size--tertiary: 0.5625rem;
  }
  &[data-size='huge'] {
    --bar-height: #{$bar-height-huge};
    --font-size--secondary: 0.5625rem;
    --font-size--tertiary: 0.5625rem;
  }
}

@mixin SequenceDiagramCard {
  .kui--data-table-wrapper.kui--data-table-as-sequence {
    @include Card {
      @content;
    }
  }
}

@mixin SequenceDiagram {
  .kui--data-table-wrapper .kui--data-table-container .kui--table-like-wrapper.kui--sequence-diagram {
    @include BarHeight;
    @content;
  }
}

@mixin SequenceDiagramGapRow {
  @include SequenceDiagram {
    tr.kui--interval-start,
    tr.kui--interval-start-jobName {
      &,
      &:hover {
        @content;
      }
    }
  }
}

@mixin SequenceDiagramGapCell {
  @include SequenceDiagramGapRow {
    td.kui--gap-cell {
      &,
      &:hover {
        @content;
      }
    }
  }
}
